| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | export default linearizeEncodings; |
||
| 5 | function linearizeEncodings(encodings){ |
||
| 6 | var linearEncodings = []; |
||
| 7 | function nextLevel(encoded){ |
||
| 8 | if(Array.isArray(encoded)){ |
||
| 9 | for(let i = 0; i < encoded.length; i++){ |
||
| 10 | nextLevel(encoded[i]); |
||
| 11 | } |
||
| 12 | } |
||
| 13 | else{ |
||
| 14 | encoded.text = encoded.text || ""; |
||
| 15 | encoded.data = encoded.data || ""; |
||
| 16 | linearEncodings.push(encoded); |
||
| 17 | } |
||
| 18 | } |
||
| 19 | nextLevel(encodings); |
||
| 20 | |||
| 21 | return linearEncodings; |
||
| 22 | } |
||
| 23 |